package com.atgm.mall.gmmallcart.exception;

import com.atgm.common.exception.CartException;
import com.atgm.common.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class CartExceptionHandler {

    @ExceptionHandler(CartException.class)
    public R handlerCartException(CartException e) {
        return R.error(e.getCode(), e.getMsg());
    }

}
